#include<bits/stdc++.h>
using namespace std;
#define gg puts("no"),exit(0)
#define N 1000010
int n,m,a[N],pr[N],sf[N],nt[N],nw=1,c[N],vi[N];
void dl(int x,int y){
sf[pr[x]]=sf[y];
pr[sf[y]]=pr[x];
}
int gt(){
while(vi[nw])nw++;
if(nw>n)gg;
vi[nw]=1;
return nw;
}
void dfs(int l,int r){
if((r-l)&1)gg;
for(int i=l;i<=r;i=sf[i])
while(nt[i]){
if(nt[i]>r)gg;
dfs(sf[i],pr[nt[i]]);
dl(sf[i],nt[i]);
nt[i]=nt[nt[i]];
}
int s=0,ct=0,rt=a[pr[l]];
for(int i=l;i<=r;i=sf[i]){
s++;
ct+=a[i]>0;
}
s=(s+1)/2;
if(ct>s)gg;
for(int i=sf[l];i<=r;i=sf[i])
if(!a[i]&&ct<s)a[i]=gt(),ct++;
if(s==1&&!ct)a[l]=gt();
for(int i=l;sf[i]<=r;i=sf[i]){
while(i>l&&sf[i]<=r&&!a[pr[i]]&&a[i]&&a[sf[i]]){
a[pr[i]]=a[sf[i]];
dl(i,sf[i]);
i=pr[pr[i]];
}
while(i>=l&&sf[sf[i]]<=r&&a[i]&&a[sf[i]]&&!a[sf[sf[i]]]){
a[sf[sf[i]]]=a[i];
dl(sf[i],sf[sf[i]]);
i=pr[i];
}
}
for(int i=l;i<=r;i=sf[i])
if(!a[i])a[i]=rt;
}
int main(){
cin>>n;
m=n*2-1;
for(int i=1;i<=m;i++){
cin>>a[i];
c[a[i]]++;
}
if(a[1]&&a[m]&&a[1]!=a[m])gg;
a[1]=a[m]=a[1]|a[m];
for(int i=0;i<=m;i++){
pr[i]=i-1;
sf[i]=i+1;
}
for(int i=m;i;i--)
if(a[i]){
nt[i]=vi[a[i]];
vi[a[i]]=i;
}
dfs(1,m);
puts("yes");
for(int i=1;i<=m;i++)
printf("%d ",a[i]);
puts("");
return 0;
}
279. Perfect Squares | 275. H-Index II |
274. H-Index | 260. Single Number III |
240. Search a 2D Matrix II | 238. Product of Array Except Self |
229. Majority Element II | 222. Count Complete Tree Nodes |
215. Kth Largest Element in an Array | 198. House Robber |
153. Find Minimum in Rotated Sorted Array | 150. Evaluate Reverse Polish Notation |
144. Binary Tree Preorder Traversal | 137. Single Number II |
130. Surrounded Regions | 129. Sum Root to Leaf Numbers |
120. Triangle | 102. Binary Tree Level Order Traversal |
96. Unique Binary Search Trees | 75. Sort Colors |
74. Search a 2D Matrix | 71. Simplify Path |
62. Unique Paths | 50. Pow(x, n) |
43. Multiply Strings | 34. Find First and Last Position of Element in Sorted Array |
33. Search in Rotated Sorted Array | 17. Letter Combinations of a Phone Number |
5. Longest Palindromic Substring | 3. Longest Substring Without Repeating Characters |